package com.hdoit.apollo.web.stock.modelconfig;

import com.hdoit.apollo.web.purchase.providers.PurchaseProvider;
import com.hdoit.apollo.web.shop.providers.SupplierProvider;
import com.hdoit.apollo.web.stock.providers.WarehouseProvider;
import com.tennetcn.core.common.enums.regular.MathRegularExpressions;
import com.tennetcn.web.component.attribute.DateTimeAttribute;
import com.tennetcn.web.component.attribute.DisplayNameAttribute;
import com.tennetcn.web.component.attribute.DropDownListAttribute;
import com.tennetcn.web.component.attribute.RegularExpressionAttribute;
import com.tennetcn.web.component.attribute.RequiredAttribute;
import com.tennetcn.web.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      humaoshu
 * @email       
 * @createtime  2018年05月28日 16:51:05
 * @comment
 */
public class InStockConfig extends ModelMetadataAttributeConfiguration{
    public InStockConfig(){
        this.setProperty("inStockNum")
            .hasAttribute(new DisplayNameAttribute("入库数"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));
        
        this.setProperty("inStockState")
            .hasAttribute(new DisplayNameAttribute("入库状态"));
        
        this.setProperty("inStockNo")
	        .hasAttribute(new RequiredAttribute("必填项"))
	        .hasAttribute(new DisplayNameAttribute("单号"));
        
        this.setProperty("warehouse")
	        .hasAttribute(new DropDownListAttribute(new WarehouseProvider()))
	        .hasAttribute(new RequiredAttribute("必填项"))
	        .hasAttribute(new DisplayNameAttribute("入库仓"));

        this.setProperty("shopId")
            .hasAttribute(new DisplayNameAttribute("门店id"));
        
        this.setProperty("comment")
        	.hasAttribute(new DisplayNameAttribute("备注"));
        
        this.setProperty("operatorName")
    		.hasAttribute(new DisplayNameAttribute("经办人"));
        
        this.setProperty("createDate")
	        .hasAttribute(new DisplayNameAttribute("入库时间"))
	        .hasAttribute(new DateTimeAttribute());
        
        this.setProperty("purchaseId")
	   		.hasAttribute(new DropDownListAttribute(new PurchaseProvider()))
	        .hasAttribute(new RequiredAttribute("必填项"))
	    	.hasAttribute(new DisplayNameAttribute("采购单号"));

        this.setProperty("supplierId")
  	   		.hasAttribute(new DropDownListAttribute(new SupplierProvider()))
  	        .hasAttribute(new RequiredAttribute("必填项"))
  	    	.hasAttribute(new DisplayNameAttribute("供应商"));
    }
}